#!/bin/sh

## java env
export JAVA_HOME=/usr/java/latest/
export JRE_HOME=$JAVA_HOME/jre

## service name
APP_NAME=ffmpeg-command

SERVICE_DIR=/home/chaoyue/shipin/base-video
SERVICE_NAME=$APP_NAME
JAR_NAME=$SERVICE_NAME*\.jar
PID=$SERVICE_NAME\.pid

cd $SERVICE_DIR

case "$1" in

    start)
        nohup ffmpeg -rtsp_transport tcp -buffer_size 2048000  -i $2 -vcodec copy -acodec copy -f flv $3  >/dev/null 2>&1 & 
		echo $! > $SERVICE_DIR/$PID
        echo `cat $SERVICE_DIR/$PID`
        ;;
esac
exit 0

